# Throw this script into your xwindows menu & at the click of a button you can have a screenshot ready for the next screenshots post!
# Save this script in your path. I put mine in /usr/local/bin. Then you can add it your window manager menu.


#!/bin/bash

# Written for Dream In Code 05/30/2008
# By #2pencil

#1st, we check for the most important piece
_path=`which import`
if [ $? -eq 1 ]; then
  echo "import command does not exist, please install it to continue"
  exit
fi
#jump to the temp directory
cd /tmp
#check for & move the last screenshot...
#remember, screenshot2.png gets trashed at this point
if [ -f screenshot1.png ]; then
  mv screenshot1.png screenshot2.png 
fi
# this should always exist
# unless it's the 1st time running...
if [ -f screenshot.png ]; then 
  mv screenshot.png screenshot1.png
fi
# Let it roll!
${_path} -window root screenshot.png